<?php
include "conf.php";
$wall=0;
define(DDG, strlen($ddg));
$path=$ddg.$dir;
$re=file_exists($pathBase);
if($re==FALSE){
	mkdir($pathBase);
}
if(!(file_exists($pathBase."readme.txt"))){
	$read="这是织梦系统自动生成的目录安全扫描文件目录,建议定期删除较早的目录,但近期的目录不要较早删除--DedeCMS";
	$hand=fopen($pathBase."readme.txt", "w+");
	fwrite($hand, $read);
}
$timeName=date("Y-m-d",time());
if(!(is_dir($pathBase.$timeName))){
	mkdir($pathBase.$timeName);
}
function fileinfo($path,$dir){
	global $wall,$timeName,$pathBase;
	$arr=scandir($path);
	foreach($arr as $v){
		if($v!="."&&$v!=".."){
			if(is_dir($path."/".$v)){
				fileinfo($path."/".$v,$dir);
			}else{
				$c=filectime("$path/$v");
				$fctime=date('Y-m-d H:i:s',$c);
				$handle = fopen($pathBase.$timeName."/".$dir.".txt","a+");
				$fwstr=substr($path."/".$v, DDG);
				$w=fwrite($handle, $fwstr."---->".$fctime."\n");
				$wall=$wall+$w;
			}
		}
	}
}
if(!(file_exists($pathBase.$timeName."/".$dir.".txt"))){
	fileinfo($path,$dir);
}
echo $pathBase.$timeName."/".$dir.".txt create OK! create：".$wall."<br>";
?>
